package com.topisv.tms.utils;

import com.topisv.tms.service.vo.PackStyleModel;

public abstract class PackStyleTablesOSA {



	public static String osaFirstTable(PackStyleModel packStyleModel) {
		StringBuffer sb = new StringBuffer("<table width='100%' style='font-size:13px;'>");
		sb.append(" <tr style='height: 25px;text-align:left'>" + "<td height='25px'>")
				.append(" 客户姓名:  " + packStyleModel.getReceiverName() + " </td>"
						+ "<td height='25px'>" + " 客户名称:  "
						+ getContent(packStyleModel.getBunick()))
				.append("</td>" + " <td height='25px'>" + " 联系电话:  "
						+ getContent(packStyleModel.getPhone()) + " </td>")
				.append(" <td height='25px'>" + "付款日期:  "
						+ getContent(packStyleModel.getPayDate()) + "</td>"
						+ "</tr>")
				.append(" <tr style='height: 25px;text-align:left'>" + "<td>" + "物流公司:  "
						+ getContent(packStyleModel.getLogisticalCode())
						+ "       "+getContent(packStyleModel.getLogisticalBill())+"</td>")
				.append(" <td>" + "所在店铺:  " +getContent( packStyleModel.getStoreName())
						+ "</td>" + "<td>" + " 发货仓库:  "
						+ getContent(packStyleModel.getDepositoryName())
						+ "</td>")
				.append("<td>" + " 打单日期:  "
						+ getContent(packStyleModel.getNowDate()) + "</td>"
						+ " </tr>" + " </table>");
		return sb.toString();
	}

	public static String osa_getCoum = "	<font color='red' size='2'> 退换货原因: 1.尺码偏大 <input"
			+ "type='checkbox'> 2.尺码偏小 <input type='checkbox'>"
			+ "	3.面料不喜欢 <input type='checkbox'> 4.试穿效果不喜欢 <input"
			+ "	type='checkbox'> 5.发错货 <input type='checkbox'>"
			+ "6.质量问题 <input type='checkbox'> 7.色差 <input type='checkbox'>"
			+ "8.其他 <input type='checkbox'> 请在退换货原因后打勾</font>";

	public static String osaTopTable(int length,PackStyleModel packStyleModel) {
		String topTableString = "";
		topTableString += "<table width='100%' border='1' cellspacing='0' style='font-size:14px;'>"
				+ "<tr style='height: 25px;text-align:center'>"
				+ "<td><div align='center'>"
				+getContent(packStyleModel.getBillNumber())
				+ "</div></td>"
				+ "<td colspan='"
				+ length
				+ "'><div align='center'>"
				+ "发货清单"
				+ "</div></td>"
				+ "<td colspan='8' width='50%'><div align='center'>" + "退换货清单" + "</div></td>" + "</tr>";
		topTableString += "<tr style='height: 25px'>" + "<td rowspan='2'><div align='center'>"
				+ "货号</div></td>";
		return topTableString;
	}

	public static String osaMiddleTable() {
		String endTableString = "";
		endTableString += "<td colspan='2'><div align='center'>" + "退货" + "</div></td>"
				+ "<td colspan='5'><div align='center'>" + "换货" + "</div></td>" + "<td><div align='center'>" + "退换货原因"
				+ "</td></div>" + "</tr>";

		endTableString += "<tr style='height: 25px;text-align:center'>" + "<td><div align='center'>" + "请打勾"
				+ "</div></td>" + "<td><div align='center'>" + "数量" + "</div></td>" + "<td><div align='center'>" + "请打勾" + "</div></td>"
				+ "<td><div align='center'>" + "换出货号" + "</div></td>" + "<td><div align='center'>" + "数量" + "</div></td>" + "<td><div align='center'>"
				+ "颜色" + "</div></td>" + "<td><div align='center'>" + "尺码" + "</div></td>" + "<td><div align='center'>" + "请填下方数字"
				+ "</div></td>" + "</tr>";
		return endTableString;
	}

	// 底部表格
	public static String osaEndTable(int length,PackStyleModel packStyleModel) {
		String endTableString = "";
		endTableString += "<tr style='height: 25px'>" + "<td><div align='center'>" + "买家备注</div></td>"
				+ "<td colspan='"
				+ (length + 8)
				+ "'><div align='center'>"+getContent(packStyleModel.getSellerBz())
				+ "</div></td>"
				+ "</tr>"
				+ "<tr style='height: 25px'>"
				+ "<td><div align='center'>"
				+ "卖家备注</div></td>"
				+ "<td colspan='"
				+ (length + 8)
				+ "'><div align='center'>"+getContent(packStyleModel.getBusinessBz())
				+ "</div></td>"
				+ "</tr>"
				+ "<tr style='height: 25px'>"
				+ "<td><div align='center'>"
				+ "退换货提醒</div></td>"
				+ "<td colspan='"
				+ (length + 8)
				+ "'><div align='center'>"+getContent(packStyleModel.getSalesRerurnMessage())
				+ "</div></td>"
				+ "</tr>"
				+ "<tr style='height: 25px'>"
				+ "<td><div align='center'>"
				+ "退换货地址</div></td>"
				+ "<td colspan='"
				+ (length + 8)
				+ "'><div align='center'>"+getContent(packStyleModel.getSalesRerurnAddress())
				+ "</div></td>"
				+ "</tr>"
				+ "</table>";
		return endTableString;
	}

	// 头部表格
	public static String commTopCommTable() {
		String topTableString = "<table width='100%' border='1' cellspacing='0'>";

		return topTableString;
	}

	public static String getContent(String content) {
		if (content == null) {
			return "";
		} else {
			return content;
		}
	}

	public static String commEndCommTable() {
		String topTableString = "</table>";
		return topTableString;
	}
}
